export interface HeadState {
  list: any[];
}

// 设置初始数据
// 相当于vuex中的state
const initState: HeadState = {
  list: [],
};

export default function (state: HeadState = initState, action: any) {
  switch (action.type) {
    case 'UPDATE':
      state = {
        ...state,
        list: action.value,
      };
      break;
    case 'ERROR':
      state = {
        ...state,
        list: [],
      };
      break;

    default:
      break;
  }
  return state;
}
